/*
 * @Author: tom
 * @Date: 2022-09-05 15:56:30
 * @LastEditors: 阿航
 * @LastEditTime: 2022-10-27 19:31:07
 * @FilePath: \shop\src\utils\auth.js
 */

/**
 *设置token
 *
 * @export
 * @param {*} token
 */
export function setToken(token) {
  sessionStorage.setItem('token', token)
}

/**
 *获取token
 *
 * @export
 * @return {*}
 */
export function getToken() {
  return sessionStorage.getItem('token')
}

/**
 *判断是否登录
 *
 * @export
 * @return {*}
 */
export function isLogined() {
  if (getToken()) {
    return true
  }
  return false
}

/**
 *删除token
 *
 * @export
 */
export function removeToken() {
  sessionStorage.removeItem('token')
}
